#pragma once

namespace Base { namespace Env {

    class Environment;

    class EnvMgr
    {
    private:
        EnvMgr();
        ~EnvMgr();

    public:
        static EnvMgr* get();

        // Get/set the command.
        void         activeEnv(const void* envId);
        Environment* activeEnv() const;

        // Modify the environment.
        void    addEnv(const std::string& name,const std::wstring& title);
        void removeEnv(const std::string& name);
        void removeEnv(const void* envId);

        // Reactivate the active command.
        void reactivateEnv();

    private:
        void activeEnv(const void* envId, const bool force);

    private:
        typedef std::map<const void*, Environment*> Environments;

        Environments    m_environments;
        Environment*    m_activeEnv;
    };

}}